package procilege.impl.expand;

import procilege.compute.ExprExpandTraveller;
import procilege.compute.PlaceTypeMetadata;
import procilege.compute.PlaceType;
import procilege.lang.EntityExprElement;
import procilege.lang.EntityExprOr;

@PlaceTypeMetadata(type = EntityExprOr.class)
public class EntityExprOrExpandPlace implements PlaceType<ExprExpandTraveller> {

	@SuppressWarnings("unchecked")
	public void visit(ExprExpandTraveller tr, Object place) {

		EntityExprOr plus = new EntityExprOr();

		for (EntityExprElement t : (EntityExprOr) place) {

			tr.setout(t);
			plus.add((EntityExprElement) tr.getPreviousVisitResult());
		}

		tr.result(plus);
	}
}